package com.wisdomparking.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.wisdomparking.bean.User;
import com.wisdomparking.dao.mapper.UserMapper;

@Component
public class UserDao implements UserMapper {
	
	@Autowired UserMapper userMapper;
	
	@Transactional
	@Override
	public int deleteByPrimaryKey(Integer id) {
		return userMapper.deleteByPrimaryKey(id);
	}
	
	@Transactional
	@Override
	public int insert(User record) {
		return userMapper.insert(record);
	}
	
	@Transactional
	@Override
	public int insertSelective(User record) {
		return userMapper.insertSelective(record);
	}
	
	@Override
	public User selectByPrimaryKey(Integer id) {
		return userMapper.selectByPrimaryKey(id);
	}
	
	@Override
	public User selectByMobileNumber(String mobileNumber){
		return userMapper.selectByMobileNumber(mobileNumber);
	}
	
	@Override
	public User selectByTempMobile(String tempMobile){
		return userMapper.selectByTempMobile(tempMobile);
	}
	
	@Transactional
	@Override
	public int updateByPrimaryKeySelective(User record) {
		return userMapper.updateByPrimaryKeySelective(record);
	}
	
	@Transactional
	@Override
	public int updateByPrimaryKey(User record) {
		return userMapper.updateByPrimaryKey(record);
	}
	
	@Override
	public List<User> getUserList(Map<String, Object> map) {
		return userMapper.getUserList(map);
	}

	@Override
	public long getCountByUser(Map<String, Object> map) {
		return userMapper.getCountByUser(map);
	}

}
